# Maintainer: Hoang Nguyen <folliekazetani@protonmail.com>
pkgname=py3-trio-websocket
pkgver=0.11.1
pkgrel=2
pkgdesc="WebSocket client and server implementation for py3-trio"
url="https://github.com/python-trio/trio-websocket"
arch="noarch"
license="MIT"
depends="
	python3
	py3-trio
	py3-wsproto
	"
makedepends="
	py3-gpep517
	py3-installer
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-pytest
	py3-pytest-trio
	py3-trustme
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/python-trio/trio-websocket/archive/refs/tags/$pkgver.tar.gz
	trio-0.25.patch
	"
builddir="$srcdir/${pkgname#py3-}-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
4b0eb6f0c012cefedb69b97e9452ba979336fbe9f154799c4c68871b8013e728374e4872a2343ab4d27fa6e25e40c3063e681e80470123d37f13f531be4f6644  py3-trio-websocket-0.11.1.tar.gz
2b592515dd1e9ca8acf96a6ff654d9de1ae37365cb0a3376838ee9b14e58e4ce268f932974960f5e044bea7ab36cded806ad85878ac0231b2c410709bea54b67  trio-0.25.patch
"
